<html>
<head>
<?php 
	session_start();
	if(empty($_SESSION['loginuser'])){
		header("Location: login.php");
		exit();		
	}
?>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<script type="text/javascript" src="./js/myjs.js"></script>
<script type="text/javascript">
	function getSignList(){
		var xmlHttpRequest = getXmlHttpObject();
		if(xmlHttpRequest){
			var url = "getSignListController.php";
			xmlHttpRequest.open("post",url,true);
			xmlHttpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			xmlHttpRequest.onreadystatechange=function(){
				if(xmlHttpRequest.readyState == 4){
					if(xmlHttpRequest.status==200){
						var res_obj = eval('('+xmlHttpRequest.responseText+')');
						//alert(res_obj);
						for(var i=0; i<res_obj.length; i++){
							if(res_obj[i].times == 1){
								var newNode = document.createElement("li");
								newNode.innerHTML=res_obj[i].userid + '&nbsp;&nbsp;&nbsp;&nbsp;,签到时间:' + res_obj[i].signTime + '&nbsp;&nbsp;&nbsp;&nbsp;,今日心情:' + res_obj[i].comment;
								$('ul2').appendChild(newNode);
							}else{
								var newNode2 = document.createElement("li");
								newNode2.innerHTML=res_obj[i].userid + '&nbsp;&nbsp;&nbsp;&nbsp;,签到时间:' + res_obj[i].signTime + '&nbsp;&nbsp;&nbsp;&nbsp;,今日心情:' + res_obj[i].comment;
								$('ul3').appendChild(newNode2);
							}
							
						}
					}
				}
			};
			xmlHttpRequest.send();
		}
	}
</script>
</head>
<center>
<h1><?php if(!empty($_SESSION['sign_res'])) echo$_SESSION['sign_res']; ?></h1>
<a href='friendList.php'>返回列表页面</a>
<hr/>
</center>
<body onload="getSignList()">
<h2>已签到成员</h2>
<ul id="ul2">
</ul>
<h2>已迟到成员</h2>
<ul id="ul3">
</ul>
</body>
</html>